/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import Model.Board;
import View.BoardInterface;
import View.ChooseMode;
import View.Creater;
import View.GameInterface;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author Admin
 */
public class ChooseModeListener extends Controller implements ActionListener {

    public ChooseModeListener(BoardInterface boardInterface, Board board, GameInterface gameInterface, ChooseMode chooseMode, Creater creater) {
        super(boardInterface, board, gameInterface, chooseMode, creater);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == chooseMode.getPlay1computerButton()) {
            numberOfModule = 2;
            gameInterface.setVisible(false);
            chooseMode.setVisible(false);
            boardInterface.setPlayer1Name("Player 1");
            boardInterface.setPlayer2Name("Player 2");
            boardInterface.setPlayer1Icon(iconTurn);
            boardInterface.setLocationRelativeTo(null);
            boardInterface.setVisible(true);
            boardInterface.getTotalMoveLabel().setVisible(false);
        }
        if (e.getSource() == chooseMode.getPlay2computerButton()) {
            numberOfModule = 3;
            gameInterface.setVisible(false);
            chooseMode.setVisible(false);
            creater.setVisible(true);
        }
    }
}
